﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace T.FAS.Runtime.Metadata.Entity.DataModel
{
    /// <summary>
    /// 数据列
    /// </summary>
    [Serializable]
    public class DataObjectColumnHelpSetting : ICloneable
    {
        public string ID { get; set; }
        public string DataColumnID { get; set; }
        public string DataObjectID { get; set; }
        public DataSourceType DataSourceType { get; set; }
        public string DataSourceID { get; set; }
        public string DataSourceCode { get; set; }
        public string DataSourceName { get; set; }
        public string ValueField { get; set; }
        public string DisplayField { get; set; }
        public string ControlID { get; set; }
        public string ControlName { get; set; }
        public string ExtSetting { get; set; }

        /// <summary>
        /// 备用字段
        /// </summary>
        [JsonIgnore]
        public string Ext1 { get; set; }

        /// <summary>
        /// 备用字段
        /// </summary>
        [JsonIgnore]
        public string Ext2 { get; set; }

        /// <summary>
        /// 备用字段
        /// </summary>
        [JsonIgnore]
        public string Ext3 { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        //[DataMember]
        [JsonIgnore]
        public string Creator { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>        
        //[DataMember]
        [JsonIgnore]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 最后修改人
        /// </summary>
        //[DataMember]
        [JsonIgnore]
        public string LastModifier { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>        
        //[DataMember]
        [JsonIgnore]
        public DateTime LastModifyTime { get; set; }

        /// <summary>
        /// 构造函数
        /// </summary>
        public DataObjectColumnHelpSetting()
        {
            this.ID = Guid.NewGuid().ToString();
        }

        public object Clone()
        {
            return this.MemberwiseClone();
        }

    }

    public enum DataSourceType
    {
        DataQuery = 0,
        Action = 1,
    }
}
